package top;

import service.*;

public class RuntimeContextProvider implements RuntimeContext {

    private static FileStoreService FILE_STORE_SERVICE = FileStoreServiceImp.getFileServiceImp();
    private static UserService USER_SERVICE = UserServiceImp.getUserServiceImp(FILE_STORE_SERVICE);
    private static GameRoomService GAME_ROOM_SERVICE = GameRoomServiceImp.getGameRoomServiceImp();
    private static PlayerService PLAYER_SERVICE = PlayerServiceImp.getPlayerServiceImp();
    private static WebsocketSessionService WEBSOCKET_SESSION_SERVICE = WebsocketSessionServiceImp.getWebsocketSessionServiceImp();
    private static RankingService RANKING_SERVICE = RankingServiceImp.getRankingServiceImp(USER_SERVICE.getAllRankedUsers());

    private static Rule rule = RuleA.getRuleA();

    private static RuntimeContextProvider provider = new RuntimeContextProvider();

    public static RuntimeContext getContextProvider() {return provider;}

    @Override
    public UserService getUserService() {
        return USER_SERVICE;
    }

    @Override
    public FileStoreService getFileStoreService() {return FILE_STORE_SERVICE;}

    @Override
    public GameRoomService getGameRoomService() {return GAME_ROOM_SERVICE;}

    @Override
    public PlayerService getPlayerService() {return PLAYER_SERVICE;}

    @Override
    public WebsocketSessionService getWebsocketSessionService() {return WEBSOCKET_SESSION_SERVICE;}

    @Override
    public RankingService getRankingService() {return RANKING_SERVICE;}

    @Override
    public Rule getRule() {return rule;}
}
